/**
 * 
 */
package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.BusinessDayDao;
import com.hera.process.config.domain.BusinessDay;
import com.hera.process.config.domain.BusinessDayPK;
import com.hera.process.config.service.BusinessDayService;

/**
 * @author cmontes
 *
 */

@Service("businessDayService")
public class BusinessDayServiceImpl implements BusinessDayService {
	static final Logger logger = Logger.getLogger(BusinessDayServiceImpl.class);

	@Autowired
	private BusinessDayDao businessDayDao;
	
	@Override
	public BusinessDay findById(BusinessDayPK id) {
		
		return businessDayDao.findOne(id);
	}

	@Override
	public void update(BusinessDay entity) {
		
		businessDayDao.save(entity);
	}

	@Override
	public void save(BusinessDay entity) {
		
		businessDayDao.save(entity);
	}

	@Override
	public void delete(BusinessDay entity) {
		
		businessDayDao.delete(entity);
	}

	@Override
	public List<BusinessDay> findAll() {
		logger.info("find all");
		return businessDayDao.findAll();
	}

	@Override
	public List<BusinessDay> findAll(FiltroDTO filtroDTO) {
		
		return businessDayDao.obtenerEntidadesPorFiltros(filtroDTO);
	}	

}
